import { createApp } from 'vue';
import attachmentModel from "./attachmentModel";
import store from "@/store";
import router from "@/router";

const showAttachmentModel = (showData) => {
    // 创建应用实例
    const app = createApp(attachmentModel);
    
    // 挂载store和router
    app.use(store);
    app.use(router);
    
    // 创建DOM容器并挂载应用
    const container = document.createElement('div');
    document.body.appendChild(container);
    
    // 挂载应用并获取实例
    const instance = app.mount(container);
    
    // 调用组件方法并返回结果
    return instance.showModal(showData);
};

export default showAttachmentModel;